|
|
|
| | | |
|
|
|
|
Identifies the location of a specific record. |
|
|
|
| | |
|
|
|
|
Moves the record pointer to a specific record position in the recordset. |
|
|
|
| | |
|
|
|
|
Moves the record pointer to the record property nearest the indicated percentage position in the recordset. |
|
|
|
|
|
|
|
|
|
|
Each of these techniques has benefits and limitations, as described in the following sections. |
|
|
|
|
|
|
|
|
You can use the five different Move methods on any recordsets available in Visual Basic: |
|
|
|
|
| | | |
|
|
|
|
Moves the record pointer from the current record to the first record in the opened recordset. |
|
|
|
| | |
|
|
|
|
Moves the record pointer from the current record to the next record (the record following the current record) in the opened recordset. If no next record exists (that is, if you are already at the last record), the end-of-file (EOF) flag is set, and there will be no current record. |
|
|
|
| | |
|
|
|
|
Moves the record pointer from the current record to the preceding record in the opened recordset. If no previous record exists (that is, if you are at the first record), the beginning-of-file (BOF) flag is set, and there will be no current record. |
|
|
|
| | |
|
|
|
|
Moves the record pointer from the current record to the last record in the opened recordset. |
|
|
|
| | |
|
|
|
|
Moves the record pointer from the current record n records down (if n is positive) or up (if n is negative) in the opened recordset. If the move would place the record pointer beyond the end of the recordset (either BOF or EOF), an error occurs. |
|
|
|
|
|
|
|
|
|
|
These commands move the record pointer to the record indicated based on the current order of the recordset. The current order of the recordset is the physical order, unless an index was set for a table, or a dynaset or snapshot was created with a particular order specified. |
|
|
|
|
|
|
|
|
To enhance the sample project to show the use of the MoveFirst, MovePrevious, MoveNext, and MoveLast methods, follow these steps: |
|
|
|
|
|
|
|
|
See "Setting the Current Index in a Table," p.581 |
|
|
|
|
|
|
|
|
1. Add four command buttons named cmdFirst, cmdPrevious, cmdNext, and cmdLast. |
|
|
|
|
|
|
|
|
2. Set their Caption properties as follows: |
|
|
|
 |
|
|
|
|
First record |
|
|
|
 |
|
|
|
|
Next record |
|
|
|
 |
|
|
|
|
Previous record |
|
|
|
 |
|
|
|
|
Last record |
|
|
|
|
|